package itcast.web.servlet;

import itcast.domain.Build;
import itcast.domain.Drom;
import itcast.domain.Studnet;
import itcast.service.BuildService;
import itcast.service.Drom_manageService;
import itcast.service.StudentService;
import itcast.service.impl.BuildServiceImpl;
import itcast.service.impl.Drom_manageServiceImpl;
import itcast.service.impl.StudentServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/findStudent_intoServlet")
public class findStudent_intoServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        //获取id
        String id=request.getParameter("id");
        //2.调用Service查询
        StudentService service=new StudentServiceImpl();
        Studnet studnet =service.findStudent_intoById(id);
        //3.将Drom存入request
        request.setAttribute("student",studnet);
        //4.转发到update_into
        request.getRequestDispatcher("/systemadmin/update_into.jsp").forward(request,response);

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        this.doPost(request,response);
    }
}
